package org.ala.tiktools.generator.mybatis.tools;

/**
 * @author ala
 * @date 2024-12-31 15:28
 */
public class FieldType {
    protected String typeName;
    protected Class<?> typeClass;

    public static FieldType build(Class<?> type, String typeName) {
        FieldType ft = new FieldType();
        ft.typeClass = type;
        ft.typeName = typeName == null ? String.format("%s.%s", type.getPackage().getName(), type.getSimpleName()) : typeName;
        return ft;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public Class<?> getTypeClass() {
        return typeClass;
    }

    public void setTypeClass(Class<?> typeClass) {
        this.typeClass = typeClass;
    }
}
